<?php 
	$s = NumberOf1(10);
	print_r($s);
	function NumberOf1($n){
		$str = decbin($n);
		$st = substr_count($str,1);
		return $st;
	}

 ?>